package com.finally语句;

/**如果finally语句中没有return语句覆盖返回值，那么原来的返回值可能因为finally里的修改而改变也可能不变
 * 
 * @author Ziroom
 *
 */
public class FinallyTest3 {

    public static void main(String[] args) {
        System.out.println(test3());
    }

    public static int test3() {
        int b = 20;
        try {
            System.out.println("try block");
            return b += 80;
        } catch (Exception e) {
            System.out.println("catch block");
            return b;
        } finally {
            System.out.println("finally block");
            if (b > 25) {
                System.out.println("b>25, b = " + b);
            }
            // java是值传递
            b = 150;
        }
    }

}